import time

import cv2
import cv2 as cv
import numpy as np
import util
from matplotlib import pyplot as plt
from PIL import Image

# coin_img_path = "/home/hhd/Downloads/roi_img.png"
import os

start = time.process_time()

# coin_img_path = "/tmp/img_left_u8.png"
# img = cv2.imread(coin_img_path)

# util.get_segmentation_result_from_img_left_u8_c3(img)

# 二维数组

#  single_roi_json_file = "/home/hhd/workspace/longi_coal_picture/jingKuang_json/json_file_with_single_roi/505_00069_30_003_0.json"
#  roi_area = util.get_roi_from_single_roi_json_file(single_roi_json_file)
#  print(np.max(roi_area))
#  roi_area_u8 = util.u16_image_2_u8(roi_area)
#  print(np.max(roi_area_u8))
import random
from util import mv_or_copy_file_randomly
import util

#  base_dir =  "/home/hhd/workspace/classification-pytorch/datasets/rois_u8/"
base_dir = "/home/hhd/workspace/longi_coal_picture/tie_xin/tie_xin_u16_c3/"
#  src_dir = base_dir +  "jingKuang_roi/"
#  mv_or_copy_file_randomly(1190, "cp", src_dir)
#  src_dir = base_dir +  "jingKuang_roi/cped_dir/"
#  mv_or_copy_file_randomly(238, "mv", src_dir)

#  src_dir = base_dir + "zhongKuang1_roi/"
#  mv_or_copy_file_randomly(34, "cp", src_dir)
#  src_dir = base_dir + "zhongKuang1_roi/cped_dir/"
#  mv_or_copy_file_randomly(4, "mv", src_dir)
#
#
#  src_dir = base_dir + "zhongKuang2_roi/"
#  mv_or_copy_file_randomly(34, "cp", src_dir)
#  src_dir = base_dir + "zhongKuang2_roi/cped_dir/"
#  mv_or_copy_file_randomly(4, "mv", src_dir)


src_dir = base_dir + "weiKuang_roi/"
#  mv_or_copy_file_randomly(1190, "cp", src_dir)
mv_or_copy_file_randomly(4330, "cp", src_dir)
src_dir = base_dir + "weiKuang_roi/cped_dir/"
mv_or_copy_file_randomly(866, "mv", src_dir)

#  test_dir = base_dir + "test"
#  train_dir = base_dir + "train"
#  cmd = "rm -rf " + test_dir
#  os.system(cmd)
#  print(cmd)
#  util.createDirIfNotExist(test_dir)

#  cmd = "rm -rf " + train_dir
#  print(cmd)
# os.system(cmd)
# util.createDirIfNotExist(test_dir)










end = time.process_time()
#
print("程序运行时间: ", end - start, " seconds")
